# 导入django下urls模块当中的path函数
from django.urls import path

# 导入当前目录下的views文件
from . import views

app_name = 'users'
# 路由列表
urlpatterns = [
    # Return login.html
    path('', views.login),
    # Login Request
    path('login/ajax/', views.login_ajax),
    # Logout Request
    path('logout/', views.logout),
    # Code Request
    path('code/', views.image_code),
    # Return register.html
    path('register/', views.register),
    # Register Request
    path('register/ajax/', views.register_ajax),
    # Return addInfo.html
    path('addinfo/', views.add_info),
    # Adding information from user
    path('addinfo/ajax/', views.add_info_ajax),

    # ------ Personal ------
    # Return personal.html
    path('personal/', views.personal),
    # Return updateInfo.html
    path('personal/update_info/', views.update_info),
    # Same function,Different page
    path('personal/update_info_ajax/', views.add_info_ajax),
    # Write message
    path('personal/order/message/add/', views.message_record_ajax),
    # Delete message
    path('personal/order/message/delete/', views.delete_message_info_ajax),
    #
    path('personal/judge/', views.whether_complete_ajax),
    # Charts Loading
    path('personal/charts/', views.charts_ajax),
    # Return personalAllOrder.html
    path('personal/allorder/', views.all_order),
    # Return personalPerOrder.html
    path('personal/perorder/', views.personal_order),
    # Return page that include search result(all order or personal order)
    path('personal/search/result/', views.search_result),
    # Update order detail
    path('personal/order/<int:order_id>/detail/update/', views.order_details_update),
    # Create order_manager
    path('personal/order/manage/create/', views.order_manager_create_ajax),
    # Update order_manager
    path('personal/order/manage/update/', views.order_manager_update_ajax),
    # Delete user (Only root can)
    path('personal/user/delete/', views.delete_user_info_ajax),
    path('personal/allorder/delete/', views.delete_order_ajax),
    # Return uploadResource.html
    path('personal/upload/resource/', views.resource_upload),

    # All Resources
    path('personal/upload/resource/company/', views.company_info_ajax),
    path('personal/upload/resource/employee/', views.employee_info_ajax),
    path('personal/upload/resource/case/', views.case_info_ajax),
    path('personal/upload/resource/hotel/', views.hotel_info_ajax),
    path('personal/upload/resource/index/', views.index_upload_ajax),

    # ------ Index ------
    # Return index.html
    path('index/', views.index),
    # Return indexMarryRes.html
    path('index/marriage_resources/', views.marriage_resources_company),
    # Return indexExcellentCase.html
    path('index/excellent_case/<int:case_id>/', views.excellent_case),
    # Return indexHotel.html
    path('index/hotel/', views.hotel_details),
    # Return indexEmployeeRes.html
    path('index/marriage_resources/<str:types>/type/', views.marriage_resources_types),
    # Return indexMarryResDetails.html (Different function return same page(different content))
    path('index/marriage_resources/company/<int:company_id>/detail',
         views.marriage_resources_company_detail),
    # Return indexMarryResDetails.html
    path('index/marriage_resources/employees/<int:employee_id>/detail',
         views.marriage_resources_types_detail),
    # Delete Resources
    path('index/marriage_resources/delete/', views.delete_res_ajax),

    # path('')
    # Debugging
    # path('report/', views.question_exhibition),
    # path('report/bug/ajax/', views.question_upload_ajax),
]
